package architecture.dbinterface;

import java.util.*;

public abstract class DatabaseInterface {

	
	public abstract String[] getAllTables();	
	public abstract String getGroupForUser(String user);	
	public abstract Vector<String> getRightsForGroup(String group);	
	public abstract Vector<String> getRestrictionsForUser(String user);	
	public abstract String getPassForUser(String username);	
	public abstract void disconnect();
	
	public Vector<String> getRightsForUser(String user) {
		String group = getGroupForUser(user);
		Vector<String> groupRights = getRightsForGroup(group);
		System.out.println("---------- Group rights: " + groupRights);
		Vector<String> userRestrictions = getRestrictionsForUser(user);
		System.out.println("---------- Restrictions: " + userRestrictions);
		for(String s : userRestrictions)
			groupRights.remove(s);
		return groupRights;
	}

}
